package com.iplant.ams.service.po.dms.maintenance;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

/**
 * 保养工单任务(设备层)
 *
 * @author YouWang·Peng
 * 2022-8-8 09:20:21
 */
@DBBasePO(TableName = "dms_maintenance_task", Name = false, Active = false, Schemas = DBSchemas.AMS, CheckName = {
        "Code"}, CodeAuto = true, CodePrefix = "DMTK-")
public class DMSMaintenanceTask extends BasePO implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
    * 设备ID
    **/
    @DBCondition
    @DBField
    public int DeviceID = 0;
    @DBJoin(name = "AssetInfoID", tableName = "dms_device_ledger", tableAsName = "dms_device_ledger1", Schemas =
            DBSchemas.AMS,
            MainTableField = "DeviceID")
    public int AssetInfoID = 0;

    /**
    * 设备名称
    **/
    @DBJoin(name = "Name", tableName = "ams_asset_list", tableAsName = "ams_asset_list1", Schemas = DBSchemas.AMS,
            JoinIndex = 2,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=ams_asset_list1.ID")
    public String DeviceName = "";
    /**
    * 设备编码
    **/
    @DBJoin(name = "Code", tableName = "ams_asset_list", tableAsName = "ams_asset_list1", Schemas = DBSchemas.AMS,
            JoinIndex = 2,
            ConditionalJoin = "dms_device_ledger1.AssetInfoID=ams_asset_list1.ID")
    public String DeviceCode = "";
    /**
    * 保养规则ID
    **/
    @DBCondition
    @DBField
    public int MaintenanceRuleID = 0;
    @DBJoin(name = "Name", tableName = "dms_maintenance_rule", tableAsName = "dms_maintenance_rule1", Schemas =
            DBSchemas.AMS,
            MainTableField = "MaintenanceRuleID")
    public String MaintenanceRuleName = "";
    @DBJoin(name = "Code", tableName = "dms_maintenance_rule", tableAsName = "dms_maintenance_rule1", Schemas =
            DBSchemas.AMS,
            MainTableField = "MaintenanceRuleID")
    public String MaintenanceRuleCode = "";

    /**
    * 派工人ID
    **/
    @DBField
    public int DispatchPersonID = 0;
    /**
    * 派工人名称
    **/
    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "mbs_user1", Schemas = DBSchemas.Basic,
            MainTableField = "DispatchPersonID")
    public String DispatchPersonName = "";
    /**
    * 派工时刻
    **/
    @DBField
    public Calendar DispatchTime = Calendar.getInstance();
    /**
    * 派工备注
    **/
    public String DispatchRemark = "";
    /**
    * 检验员ID
    **/
    @DBField
    public int CheckerID = 0;
    /**
    * 检验员名称
    **/
    @DBJoin(name = "Name", tableName = "mbs_user", tableAsName = "mbs_user2", Schemas = DBSchemas.Basic,
            MainTableField = "CheckerID")
    public String CheckerName = "";
    /**
    * 检验时刻
    **/
    @DBField
    public Calendar CheckerTime = Calendar.getInstance();
    /**
    * 检验备注
    **/
    @DBField
    public String CheckerRemark = "";
    /**
    * 任务备注
    **/
    @DBField
    public String Remark = "";
    /**
    * 保养结果
    **/
    @DBField
    public int Result = 0;
    /**
    * 任务状态
    **/
    @DBField
    public int Status = 0;
    /**
    * 保养项列表
    **/
    public List<DMSMaintenanceItem> MaintenanceItemList = new ArrayList<>();

    @JsonProperty("DeviceID")
    public int getDeviceID() {
        return DeviceID;
    }

    public void setDeviceID(int deviceID) {
        DeviceID = deviceID;
    }

    @JsonProperty("DeviceName")
    public String getDeviceName() {
        return DeviceName;
    }

    public void setDeviceName(String deviceName) {
        DeviceName = deviceName;
    }

    @JsonProperty("DeviceCode")
    public String getDeviceCode() {
        return DeviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        DeviceCode = deviceCode;
    }

    @JsonProperty("MaintenanceRuleID")
    public int getMaintenanceRuleID() {
        return MaintenanceRuleID;
    }

    public void setMaintenanceRuleID(int maintenanceRuleID) {
        MaintenanceRuleID = maintenanceRuleID;
    }

    @JsonProperty("MaintenanceRuleName")
    public String getMaintenanceRuleName() {
        return MaintenanceRuleName;
    }

    public void setMaintenanceRuleName(String maintenanceRuleName) {
        MaintenanceRuleName = maintenanceRuleName;
    }

    @JsonProperty("MaintenanceRuleCode")
    public String getMaintenanceRuleCode() {
        return MaintenanceRuleCode;
    }

    public void setMaintenanceRuleCode(String maintenanceRuleCode) {
        MaintenanceRuleCode = maintenanceRuleCode;
    }

    @JsonProperty("DispatchPersonID")
    public int getDispatchPersonID() {
        return DispatchPersonID;
    }

    public void setDispatchPersonID(int dispatchPersonID) {
        DispatchPersonID = dispatchPersonID;
    }

    @JsonProperty("DispatchPersonName")
    public String getDispatchPersonName() {
        return DispatchPersonName;
    }

    public void setDispatchPersonName(String dispatchPersonName) {
        DispatchPersonName = dispatchPersonName;
    }

    @JsonProperty("DispatchTime")
    public Calendar getDispatchTime() {
        return DispatchTime;
    }

    public void setDispatchTime(Calendar dispatchTime) {
        DispatchTime = dispatchTime;
    }

    @JsonProperty("DispatchRemark")
    public String getDispatchRemark() {
        return DispatchRemark;
    }

    public void setDispatchRemark(String dispatchRemark) {
        DispatchRemark = dispatchRemark;
    }

    @JsonProperty("CheckerID")
    public int getCheckerID() {
        return CheckerID;
    }

    public void setCheckerID(int checkerID) {
        CheckerID = checkerID;
    }

    @JsonProperty("CheckerName")
    public String getCheckerName() {
        return CheckerName;
    }

    public void setCheckerName(String checkerName) {
        CheckerName = checkerName;
    }

    @JsonProperty("CheckerTime")
    public Calendar getCheckerTime() {
        return CheckerTime;
    }

    public void setCheckerTime(Calendar checkerTime) {
        CheckerTime = checkerTime;
    }

    @JsonProperty("CheckerRemark")
    public String getCheckerRemark() {
        return CheckerRemark;
    }

    public void setCheckerRemark(String checkerRemark) {
        CheckerRemark = checkerRemark;
    }

    @JsonProperty("Remark")
    public String getRemark() {
        return Remark;
    }

    public void setRemark(String remark) {
        Remark = remark;
    }

    @JsonProperty("Result")
    public int getResult() {
        return Result;
    }

    public void setResult(int result) {
        Result = result;
    }

    @JsonProperty("Status")
    public int getStatus() {
        return Status;
    }

    public void setStatus(int status) {
        Status = status;
    }

    @JsonProperty("MaintenanceItemList")
    public List<DMSMaintenanceItem> getMaintenanceItemList() {
        return MaintenanceItemList;
    }

    public void setMaintenanceItemList(List<DMSMaintenanceItem> maintenanceItemList) {
        MaintenanceItemList = maintenanceItemList;
    }

    @JsonProperty("AssetInfoID")
    public int getAssetInfoID() {
        return AssetInfoID;
    }

    public void setAssetInfoID(int assetInfoID) {
        AssetInfoID = assetInfoID;
    }
}
